<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2024/3/21
  Time: 16:52
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
    <h2>
        <ul>
            <li>
                系统管理
                <ul>
                    <li><a href="user/list.jsp" target="right">用户管理</a></li>
                    <li><a href="role/list.jsp" target="right">角色管理</a></li>
                    <li><a href="role/list.jsp" target="right">修改密码</a></li>
                    <li><a href="#" target="right" onclick="exit()">退出系统</a></li>

                </ul>
            </li>

        </ul>
        <ul>
            <li>
                商务管理
                <ul>
                    <li><a href="goods/list.jsp" target="right">商品管理</a></li>
                    <li><a href="customer/list.jsp" target="right">客户管理</a></li>
                    <li><a href="supplier/list.jsp" target="right">供应商管理</a></li>
                    <li><a href="goodschange/list.jsp" target="right">进出库存</a></li>
                </ul>
            </li>
        </ul>
        <ul>
            <li>
                进货管理
                <ul>
                    <li><a href="purchase/add.jsp" target="right">进货入库（添加）</a></li>
                    <li><a href="purchase/list.jsp" target="right">进货单据列表</a></li>
                    <li><a href="purchase/remove.jsp" target="right">退出出库（添加）</a></li>
                    <li><a href="goodschange/list.jsp" target="right">退货单据列表</a></li>
                </ul>
            </li>
        </ul>
    </h2>
</body>
<script>
    function exit(){
        if(confirm("确定退出？")){
            $.ajax({
                url:"/user/exit",
                type:"post",
                dataType:"json",
                success(res){
                    console.log(res);
                    if(res===200){
                        //退回根目录
                        top.location.href = "view/login.jsp"
                    }
                },
                error(){
                    alert("服务器故障")
                }

            })
        }
    }
</script>
</html>
